#include "SceneMain.h"

CSceneMain::CSceneMain(HINSTANCE hInstance, LPWSTR name, int mode, int isFullScreen, int frameRate) :
CGame(hInstance, name, mode, isFullScreen, frameRate)
{
	mpKitty = new CKitty();
}

CSceneMain::~CSceneMain()
{
	UnloadResources();
}

void CSceneMain::LoadResources()
{
	srand((unsigned)time(NULL));

	// TO-DO: not a very good place to initial sprite handler
	//D3DXCreateSprite(d3dDv, &mSpriteHandler);

	//mBackground = CreateSurfaceFromFile(mD3dDv, BACKGROUND_FILE);

	//HRESULT res = D3DXCreateSprite(mD3dDv, &mSpriteHandler);

	mpKitty->LoadContent(mSpriteHandler);
}

void CSceneMain::ProcessInput()
{
	mpKitty->Input();
}

void CSceneMain::GameUpdate(int deltaTime)
{
	mpKitty->Update(deltaTime);
}

void CSceneMain::GameRender()
{
	// Background
	//d3dDv->StretchRect(
	//	mBackground,			// from 
	//	NULL,				// which portion?
	//	mBackBuffer,		// to 
	//	NULL,				// which portion?
	//	D3DTEXF_NONE);

	mpKitty->Render();
}

void CSceneMain::UnloadResources()
{
	delete mpKitty;
	//delete mBackground;
}




